import 'package:flutter/material.dart';
import 'package:shared_preferences/shared_preferences.dart';
import 'package:yueyin/global/global_theme.dart';
import 'package:yueyin/global/yin.dart';

class ThemeService extends ChangeNotifier {
  late int _color = _preferences.getInt('color') ?? 0;

  late SharedPreferences _preferences = Yin().preferences;

  int get color => _color;



  change(int color) {
    if (color >= themeColors.length) return;
    _color = color;
    _preferences.setInt('color', _color);
    notifyListeners();
  }
}
